layui.use(['form','layer','jquery'], function (){
   var form = layui.form,
    layer = layui.layer,
    jquery = layui.jquery;

   // 登录
    form.on("submit(login)",function (data){
        $(this).text("登录中...").attr("disabled","disbaled").addClass("layui-disabled");
        setTimeout(function (){
           $("#loginFrm").submit();
        },1000);

        return false;
    });

    $("#loginname").click(function (){
       $("#msg").fadeOut(500);
    });

    $("#pwd").click(function (){
        $("#msg").fadeOut(500);
    });

    // 表单输入
    $(".loginBody .input-item").click(function (e){
        e.stopPropagation();
        $(this).addClass("layui-input-focus").find(".layui-input").focus();
    });

    $(".loginBody .layui-form-item .layui-input").focus(function (){
        $(this).parent().addClass("layui-input-focus");
    });
    $(".loginBody .layui-form-item .layui-input").blur(function (){
       $(this).parent().removeClass("layui-input-focus");
       if($(this).val() != ''){
           $(this).parent().addClass("layui-input-active");
       }else{
           $(this).parent().removeClass("layui-input-active");
       }
    });
});